package com.leet.meituan;


import java.lang.reflect.Array;
import java.util.*;

public class PriorityQ {

    public static void main(String[] args) {
        PriorityQueue<AbstractMap.SimpleEntry<Long,Long>> priorityQueue = new PriorityQueue<>(new Comparator<AbstractMap.SimpleEntry<Long, Long>>() {
            @Override
            public int compare(AbstractMap.SimpleEntry<Long, Long> o1, AbstractMap.SimpleEntry<Long, Long> o2) {
                return (int) (o2.getValue()-o1.getValue());
            }
        });
        Scanner sc;
        String[] s;
        long a,b,c,d,e,f,g;
        sc = new Scanner(System.in);
        s = sc.nextLine().split(" ");
        a = Long.parseLong(s[0]);
        b = Long.parseLong(s[1]);
        c = Long.parseLong(s[2]);
        d = Long.parseLong(s[3]);
        e = Long.parseLong(s[4]);
        f = Long.parseLong(s[5]);
        g = Long.parseLong(s[6]);
        priorityQueue.add(new AbstractMap.SimpleEntry<>(a,e));
        priorityQueue.add(new AbstractMap.SimpleEntry<>(b,f));
        priorityQueue.add(new AbstractMap.SimpleEntry<>(c,g));
        long ans = 0;
        while(d!=0 && !priorityQueue.isEmpty()){
            Map.Entry<Long, Long> head = priorityQueue.poll();
            Long num = head.getKey();
            if(d <= num){
                ans += head.getValue()*d;
                break;
            }else {
                ans += head.getValue()*num;
                d -= num;
            }
        }
        System.out.println(ans);
    }


}
